<template>
  <div class="error">
    <div class="imgWrapper">
      <img src="~img/errorPages/404.png" alt="404">
      <div class="tips">
        <p>页面出错啦，打不开网页？试试刷新网页或者回到首页</p>
        <p class="btn">
          <el-button type="primary" @click="refresh">刷新网页</el-button>
          <el-button type="primary" @click="$router.replace('/home')">返回首页</el-button>
        </p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
    }
  },
  methods: {
    refresh() {
      location.reload()
    }
  }
}
</script>
<style lang="less" scoped>
  .error {
    width: 100%;
    height: 100%;
    position: relative;
    .imgWrapper {
      position: absolute;
      top: 30%;
      left: 50%;
      transform: translate(-50%, -30%);
      .tips {
        position: absolute;
        bottom: -30px;
        left: 48%;
        transform: translateX(-48%);
        .btn {
          margin-top: 30px;
          text-align: center;
        }
      }
    }
  }
</style>
